var a, t = require("../../../@babel/runtime/helpers/defineProperty");

function e(a, t, e) {
    return t in a ? Object.defineProperty(a, t, {
        value: e,
        enumerable: !0,
        configurable: !0,
        writable: !0
    }) : a[t] = e, a;
}

var n = require("../../resource/js/time.js"), o = require("../../../33C406676D08C8FF55A26E60F51510A7.js"), i = (getApp(), 
require("../../resource/js/lanch.js")), s = require("../../resource/js/md5.js"), r = getApp();

Page({
    data: (a = {
        showTopTips: !1,
        color: "#FB6B52",
        errorMessage: "错误提示",
        inputvalue: "",
        loginState: 0,
        appname: "",
        title: "",
        nowtime: "",
        description: "",
        buttonjiexi: "recommend",
        qqgourp: "",
        shareTitle: "",
        api_url: "",
        helpUrl: "",
        adId: "",
        adcpid: "",
        adspid: "",
        share_img: "",
        progress: 0,
        adImg: "",
        adText: "",
        copyText: null,
        isAudit: "0",
        tuijian: "0",
        downurl: "",
        jlnum: "",
        isMember: "",
        url: "",
        name: 0,
        userInfo: ""
    }, t(a, "tuijian", 0), t(a, "dayad", ""), t(a, "dayadid", ""), t(a, "vipad", ""), 
    t(a, "sponsor", ""), t(a, "openpl", ""), t(a, "indicatorDots", !0), t(a, "autoplay", !0), 
    t(a, "interval", 6e3), t(a, "duration", 800), t(a, "circular", !0), t(a, "tiao_title", ""), 
    t(a, "tiao_title_url", ""), o = a, e(o, "progress", ""), e(o, "playurl", ""), e(o, "adUnitIds", ""), 
    e(o, "scrollTop", 0), e(o, "playimg", ""), e(o, "playimgs", ""), e(o, "showAddMeBtn", !0), 
    e(o, "isTop", 0), e(o, "jiexibut", ""), o),
    onLoad: function(a) {
        if (wx.setNavigationBarTitle({
            title: "情话"
        }), wx.getStorageSync("invita_openid").length < 5) {
            var t = a.openid || "";
            wx.setStorageSync("invita_openid", t);
        }
    },
    swiperChange: function(a) {
        this.setData({
            swiperCurrent: a.detail.current
        });
    },
    onShow: function(a) {
        
    },
  
    onClickAddToMinProgramCloseBtn: function() {
        wx.setStorageSync("showAddMeFlag" + this.data.time, !0), this.setData({
            showAddMeBtn: !1
        });
    },
    start: function() {
        this.setData({
            color: "#ffb428"
        });
    },
    end: function() {
        this.setData({
            color: "#faa508"
        });
    },
    help: function() {
        this.data.tiao_title_url.length > 6 ? wx.navigateTo({
            url: "../../pages/web/index?url=" + this.data.tiao_title_url
        }) : wx.navigateTo({
            url: "../help/index"
        });
    },
    toduihuan: function() {
        wx.navigateTo({
            url: "../keypay/keypay"
        });
    },
    up: function() {
        var a = this;
        wx.getUserProfile({
            desc: "用于完善用户资料",
            success: function(t) {
                a.setData({
                    userInfo: t.userInfo,
                    hasUserInfo: !0
                }), r.util.request({
                    url: "entry/wxapp/Userup",
                    data: {
                        name: t.userInfo.nickName,
                        head: t.userInfo.avatarUrl,
                        gender: t.userInfo.gender,
                        city: t.userInfo.city,
                        province: t.userInfo.province
                    },
                    method: "GET",
                    header: {
                        "content-type": "application/json"
                    }
                });
            },
            fail: function(a) {
                console.log(a), wx.showModal({
                    title: "获取信息失败",
                    content: "请允许授权以便为您提供服务",
                    confirmColor: "#FB6B52",
                    showCancel: !1,
                    success: function(a) {
                        var t = this;
                        wx.getUserProfile({
                            desc: "用于完善用户资料",
                            success: function(a) {
                                t.setData({
                                    userInfo: a.userInfo,
                                    hasUserInfo: !0
                                }), r.util.request({
                                    url: "entry/wxapp/Userup",
                                    data: {
                                        name: a.userInfo.nickName,
                                        head: a.userInfo.avatarUrl,
                                        gender: a.userInfo.gender,
                                        city: a.userInfo.city,
                                        province: a.userInfo.province
                                    },
                                    method: "GET",
                                    header: {
                                        "content-type": "application/json"
                                    }
                                });
                            },
                            fail: function(a) {
                                console.log(a), wx.showModal({
                                    title: "获取信息失败",
                                    content: "我一定会回来的 ~",
                                    confirmColor: "#FB6B52",
                                    showCancel: !1,
                                    success: function(a) {}
                                });
                            }
                        });
                    }
                });
            }
        });
    },
    onPageScroll: function(a) {
        var t = this;
        a.scrollTop <= 0 ? a.scrollTop = 0 : a.scrollTop > wx.getSystemInfoSync().windowHeight && (a.scrollTop = wx.getSystemInfoSync().windowHeight), 
        a.scrollTop > this.data.scrollTop || a.scrollTop >= this.data.scrollHeight ? console.log("向下滚动") : console.log("向上滚动"), 
        setTimeout(function() {
            t.setData({
                scrollTop: a.scrollTop
            });
        }, 0);
    },
    onClose1: function(a) {
        this.setData({
            scrollTop: 0
        });
    },
    _eventbackToTop: function() {
        wx.pageScrollTo({
            scrollTop: 0,
            duration: 300
        });
    },
    goqinghua: function() {
        wx.navigateTo({
          url: '/pages/qinghua/qinghua',
        })
    },gotiangou: function() {
        wx.navigateTo({
          url: '/pages/tiangou/tiangou',
        })
    },gozhanv: function() {
        wx.navigateTo({
          url: '/pages/zhanv/zhanv',
        })
    },gonuannan: function() {
        wx.navigateTo({
          url: '/pages/nuannan/nuannan',
        })
    },
    gomd5: function() {
        wx.switchTab({
            url: "/tommie_duanshiping/pages/md5/index"
        });
    },
    onShareAppMessage: function(a) {
        return a.from, {
            title: this.data.shareTitle,
            path: "/tommie_duanshiping/pages/index/index?openid=" + wx.getStorageSync("share_openid"),
            imageUrl: this.data.share_img
        };
    },
    onShareTimeline: function() {
        return {
            title: this.data.shareTitle,
            path: "/tommie_duanshiping/pages/index/index?openid=" + wx.getStorageSync("share_openid"),
            imageUrl: this.data.share_img
        };
    }
});